//
//  AppDelegate.swift
//  Auscultation
//
//  Created by 来 on 2020/11/27.
//

import UIKit
@_exported import LGFSwiftTool
@_exported import SnapKit
@_exported import SDWebImage
@_exported import IQKeyboardManagerSwift
@_exported import EVReflection
@_exported import LGFSwiftPT
@_exported import Charts
@_exported import Alamofire
@_exported import StreamingKit

// 本地样本录音数组(附带患者数据)
let LGF_BD_WAV_ARRAY: String = "LGF_BD_WAV_ARRAY"

let LGF_Documents: String = NSHomeDirectory() + "/Documents"
let LGF_Documents_PCM: String = LGF_Documents + "/PCM"
let LGF_Documents_WAV: String = LGF_Documents + "/WAV"
let LGF_Documents_Download: String = LGF_Documents + "/Download"

@main
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        
        // 键盘
        IQKeyboardManager.shared.enable = true
        
        // SVProgressHUD 初始化
        SVProgressHUDHelper.configSVProgressHUD()
        
        autoLogin()
        
        creatPcmFile()
        
        // 数据复位, 调试时使用
//        UserDefaults.standard.removeObject(forKey: LGF_BD_WAV_ARRAY)
        
        window!.makeKeyAndVisible()
        
        
        
        return true
    }
    
    func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
//        let token: String = deviceToken.lgf_HexString
    }
    
    func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
        if LGF_ShouldAutorotate.lgf.lgf_IsShouldAutorotate {
            return .all
        }
        return .portrait
    }
    
    func applicationDidEnterBackground(_ application: UIApplication) {
    }
    
    func applicationDidBecomeActive(_ application: UIApplication) {
    }
    
    func applicationWillResignActive(_ application: UIApplication) { }
    
    func applicationWillEnterForeground(_ application: UIApplication) { }
    
    func applicationWillTerminate(_ application: UIApplication) { }

}

